package com.health.db.dao.order.impl;


import java.util.List;

import com.health.db.dao.ServiceInterface;
import com.health.db.dao.order.IZAdviceListDao;
import com.health.db.mapper.ZAdviceListMapper;
import com.health.db.model.ZAdviceList;
import com.health.redis.RedisConstants;


public class ZAdviceListDaoImpl extends ServiceInterface implements IZAdviceListDao{

	private ZAdviceListMapper zAdviceListMapper;
	@Override
	public List<ZAdviceList> selectSimpleForInit() {
		// TODO Auto-generated method stub
		 
		
		String key=RedisConstants.ZAdviceListMapper+"";
		List<ZAdviceList> list=null;
		Object object=null;
		
		if(redisOperatiorLogic.isJedisIsConnected())
		{
			object = redisOperatiorLogic.readObject(key, getOrderRedisGroupNo("1"));
		}
		if(null!=object&&!object.equals("")){
			list =  (List) object;
		}
		else
		{
			list=zAdviceListMapper.selectSimpleForInit();

			if(redisOperatiorLogic.isJedisIsConnected())
			{
			redisOperatiorLogic.setEx(key, list, getOrderRedisGroupNo("1"));
			}
		}
		return list;
		
	}
	/**
	 * @return the zAdviceListMapper
	 */
	public ZAdviceListMapper getzAdviceListMapper() {
		return zAdviceListMapper;
	}
	/**
	 * @param zAdviceListMapper the zAdviceListMapper to set
	 */
	public void setzAdviceListMapper(ZAdviceListMapper zAdviceListMapper) {
		this.zAdviceListMapper = zAdviceListMapper;
	}
	
}
